import { EntitySchema } from '@mikro-orm/core';

export class LeLiveRoom {
  id!: string;
  roomId!: string;
  anchorWechat!: string;
  subWechat!: string;
  AppID!: string;
  merchantId!: string;
  createdTime?: number = 0;
  updatedTime?: number = 0;
  deletedTime?: number = 0;
  isDeleted?: number = 0;
}

export const LeLiveRoomSchema = new EntitySchema({
  class: LeLiveRoom,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    roomId: { type: 'string', columnType: 'bigint' },
    anchorWechat: { type: 'string', length: 128 },
    subWechat: { type: 'string', length: 128 },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
    merchantId: { type: 'string', columnType: 'bigint', defaultRaw: `1` },
    createdTime: { type: 'number', nullable: true, default: 0 },
    updatedTime: { type: 'number', nullable: true, default: 0 },
    deletedTime: { type: 'number', nullable: true, default: 0 },
    isDeleted: { type: 'number', columnType: 'tinyint', nullable: true, default: 0 },
  },
});
